package fanshe;

import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;

public class lianxi {
	public static void main(String[] args) throws Exception {
		String path="fanshe.user";
		try {
			Class c=Class.forName(path);
			System.out.println(c);
			System.out.println(c.getName());
			Field[] fields=c.getDeclaredFields();
			Field d=c.getDeclaredField("age");
			System.out.println(d);
			for (Field field : fields) {
				System.out.println(field);
			}
			System.out.println(fields.length);
			Method[] m=c.getDeclaredMethods();
			for (Method field :m) {
				System.out.println(field);
			}
			Constructor[] b=c.getConstructors();
			for (Constructor field :b) {
				System.out.println(field);
			}
			Constructor k=c.getDeclaredConstructor(int.class,int.class,String.class);
			System.out.println(k);
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
